def rand7():
    return 1

class Solution(object):
    def rand10(self):
        """
        :rtype: int
        """
        num = rand7()
        while num == 7:
            num = rand7()
        base = 5 * ((num - 1) // 3)
        num = rand7()
        while num > 5:
            num = rand7()
        return base + num
